<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			input {
				border: #FFA500 solid 0.0625rem;
				font-size: 14px;
				width: 190px;
				height: 19px;
				padding-bottom: 11px;
				padding-left: 20px;
				padding-top: 16px;
			}
		</style>
	</head>
	<body>
		<input type="text" placeholder="输入验证码" />
		<button>发送验证码</button>
		<script type="text/javascript">
			var time = 5;
			var btn = document.querySelector("button");
			btn.addEventListener("click", function() {
				btn.disabled = true;
				var si = setInterval(function() {
					if (time == 0) {
						clearInterval(si);
						btn.disabled = false;
						btn.innerHTML = "发送验证码";
					} else {
						btn.innerHTML = time + "s后重写获取";
						time--;
					}
				}, 1000);

			})
		</script>
	</body>
</html>
